home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1995 March / PC Plus Super CD (Issue 101) (March 1995).iso / sharewar / vbaddon / vbfiles / sam4info.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-06-19  |  9.7 KB  |  274 lines

  1. VERSION 2.00
  2. Begin Form frmInfo 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "VB/ISAM Sample Program SAM4 -- Dataset Info"
  5.    ClientHeight    =   3105
  6.    ClientLeft      =   1920
  7.    ClientTop       =   1785
  8.    ClientWidth     =   5820
  9.    ControlBox      =   0   'False
  10.    Height          =   3795
  11.    Left            =   1860
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3105
  16.    ScaleWidth      =   5820
  17.    Top             =   1155
  18.    Width           =   5940
  19.    Begin SSPanel pnlWholeForm 
  20.       Align           =   1  'Align Top
  21.       Alignment       =   6  'Center - TOP
  22.       BackColor       =   &H00C0C0C0&
  23.       BevelInner      =   1  'Inset
  24.       Font3D          =   0  'None
  25.       ForeColor       =   &H00FF0000&
  26.       Height          =   3105
  27.       Left            =   0
  28.       TabIndex        =   0
  29.       Top             =   0
  30.       Width           =   5820
  31.       Begin SSPanel pnlSpinner 
  32.          BackColor       =   &H00C0C0C0&
  33.          BevelInner      =   1  'Inset
  34.          Font3D          =   0  'None
  35.          ForeColor       =   &H00FF0000&
  36.          Height          =   615
  37.          Left            =   4890
  38.          TabIndex        =   13
  39.          Top             =   1740
  40.          Width           =   495
  41.          Begin SpinButton spnSpinButton 
  42.             BackColor       =   &H00C0C0C0&
  43.             Delay           =   75
  44.             ForeColor       =   &H00000000&
  45.             Height          =   435
  46.             Left            =   90
  47.             ShadowBackColor =   &H00808080&
  48.             ShadowForeColor =   &H00FFFFFF&
  49.             SpinForeColor   =   &H000000FF&
  50.             TdThickness     =   2
  51.             Top             =   90
  52.             Width           =   315
  53.          End
  54.       End
  55.       Begin SSPanel pnlDoneButton 
  56.          BackColor       =   &H00C0C0C0&
  57.          BevelInner      =   1  'Inset
  58.          Font3D          =   0  'None
  59.          ForeColor       =   &H00FF0000&
  60.          Height          =   975
  61.          Left            =   4020
  62.          TabIndex        =   10
  63.          Top             =   420
  64.          Width           =   1365
  65.          Begin SSCommand cmdOK 
  66.             Caption         =   "OK"
  67.             Font3D          =   0  'None
  68.             FontBold        =   0   'False
  69.             FontItalic      =   0   'False
  70.             FontName        =   "MS Sans Serif"
  71.             FontSize        =   8.25
  72.             FontStrikethru  =   0   'False
  73.             FontUnderline   =   0   'False
  74.             Height          =   795
  75.             Left            =   90
  76.             Outline         =   0   'False
  77.             Picture         =   SAM4INFO.FRX:0000
  78.             TabIndex        =   6
  79.             Top             =   90
  80.             Width           =   1185
  81.          End
  82.       End
  83.       Begin Label Label6 
  84.          BackStyle       =   0  'Transparent
  85.          Caption         =   "**     % =integer; && =long; ! =single; # =double; @ =currency; $ = variable-length string; $*n = fixed-length string.  X=index.  Field 000 is the primary (""P"") index -- with UNIQUE keys."
  86.          FontBold        =   0   'False
  87.          FontItalic      =   0   'False
  88.          FontName        =   "MS Sans Serif"
  89.          FontSize        =   8.25
  90.          FontStrikethru  =   0   'False
  91.          FontUnderline   =   0   'False
  92.          Height          =   645
  93.          Left            =   480
  94.          TabIndex        =   14
  95.          Top             =   2190
  96.          Width           =   4305
  97.       End
  98.       Begin Label lblFieldInfo 
  99.          BackColor       =   &H00FFFFFF&
  100.          BorderStyle     =   1  'Fixed Single
  101.          Caption         =   "123 [X$*123]"
  102.          Height          =   255
  103.          Left            =   480
  104.          TabIndex        =   12
  105.          Top             =   1890
  106.          Width           =   4215
  107.       End
  108.       Begin Label Label5 
  109.          BackStyle       =   0  'Transparent
  110.          Caption         =   "Field No. [Type**] Name"
  111.          FontBold        =   0   'False
  112.          FontItalic      =   0   'False
  113.          FontName        =   "MS Sans Serif"
  114.          FontSize        =   8.25
  115.          FontStrikethru  =   0   'False
  116.          FontUnderline   =   0   'False
  117.          Height          =   225
  118.          Left            =   480
  119.          TabIndex        =   11
  120.          Top             =   1650
  121.          Width           =   1875
  122.       End
  123.       Begin Label lblFreeFileNoteSpace 
  124.          BorderStyle     =   1  'Fixed Single
  125.          Height          =   225
  126.          Left            =   2520
  127.          TabIndex        =   9
  128.          Top             =   1170
  129.          Width           =   1215
  130.       End
  131.       Begin Label lblGroupsUsed 
  132.          BorderStyle     =   1  'Fixed Single
  133.          Height          =   225
  134.          Left            =   2520
  135.          TabIndex        =   8
  136.          Top             =   930
  137.          Width           =   1215
  138.       End
  139.       Begin Label lblGroupSize 
  140.          BorderStyle     =   1  'Fixed Single
  141.          Height          =   225
  142.          Left            =   2520
  143.          TabIndex        =   7
  144.          Top             =   690
  145.          Width           =   1215
  146.       End
  147.       Begin Label lblRecordsInFile 
  148.          BorderStyle     =   1  'Fixed Single
  149.          Height          =   225
  150.          Left            =   2520
  151.          TabIndex        =   5
  152.          Top             =   450
  153.          Width           =   1215
  154.       End
  155.       Begin Label Label4 
  156.          Alignment       =   1  'Right Justify
  157.          BackStyle       =   0  'Transparent
  158.          Caption         =   "Free file note space (bytes):"
  159.          FontBold        =   0   'False
  160.          FontItalic      =   0   'False
  161.          FontName        =   "MS Sans Serif"
  162.          FontSize        =   8.25
  163.          FontStrikethru  =   0   'False
  164.          FontUnderline   =   0   'False
  165.          Height          =   225
  166.          Left            =   480
  167.          TabIndex        =   4
  168.          Top             =   1170
  169.          Width           =   1965
  170.       End
  171.       Begin Label Label3 
  172.          Alignment       =   1  'Right Justify
  173.          BackStyle       =   0  'Transparent
  174.          Caption         =   "Number of groups used:"
  175.          FontBold        =   0   'False
  176.          FontItalic      =   0   'False
  177.          FontName        =   "MS Sans Serif"
  178.          FontSize        =   8.25
  179.          FontStrikethru  =   0   'False
  180.          FontUnderline   =   0   'False
  181.          Height          =   225
  182.          Left            =   480
  183.          TabIndex        =   3
  184.          Top             =   930
  185.          Width           =   1965
  186.       End
  187.       Begin Label Label2 
  188.          Alignment       =   1  'Right Justify
  189.          BackStyle       =   0  'Transparent
  190.          Caption         =   "Group size (bytes):"
  191.          FontBold        =   0   'False
  192.          FontItalic      =   0   'False
  193.          FontName        =   "MS Sans Serif"
  194.          FontSize        =   8.25
  195.          FontStrikethru  =   0   'False
  196.          FontUnderline   =   0   'False
  197.          Height          =   225
  198.          Left            =   480
  199.          TabIndex        =   2
  200.          Top             =   690
  201.          Width           =   1965
  202.       End
  203.       Begin Label Label1 
  204.          Alignment       =   1  'Right Justify
  205.          BackStyle       =   0  'Transparent
  206.          Caption         =   "Number of records:"
  207.          FontBold        =   0   'False
  208.          FontItalic      =   0   'False
  209.          FontName        =   "MS Sans Serif"
  210.          FontSize        =   8.25
  211.          FontStrikethru  =   0   'False
  212.          FontUnderline   =   0   'False
  213.          Height          =   225
  214.          Left            =   480
  215.          TabIndex        =   1
  216.          Top             =   450
  217.          Width           =   1965
  218.       End
  219.    End
  220.    Begin Menu mnuMouseless 
  221.       Caption         =   "Mouseless operation"
  222.       Begin Menu mnuSpinHigher 
  223.          Caption         =   "Spin to &higher field"
  224.       End
  225.       Begin Menu mnuSpinLower 
  226.          Caption         =   "Spin to &lower field"
  227.       End
  228.    End
  229. Option Explicit
  230. Sub cmdOK_Click ()
  231.     Me.Hide
  232. End Sub
  233. Sub DisplayFieldInfo ()
  234.     SchemaLine = DS_GetField(Schema, CRLFDelim, FieldNum + 1)
  235.     ThisType = DS_GetField(SchemaLine, BarDelim, 2)
  236.     If ThisType = "&" Then  'Windows gets weird with ampersands!
  237.         lblFieldInfo.Caption = Format$(FieldNum, "000") & " [" & "&&" & "] " & DS_GetField(SchemaLine, BarDelim, 3)
  238.     Else
  239.         lblFieldInfo.Caption = Format$(FieldNum, "000") & " [" & ThisType & "] " & DS_GetField(SchemaLine, BarDelim, 3)
  240.     End If
  241.     lblFieldInfo.Refresh
  242. End Sub
  243. Sub Form_Activate ()
  244.     rc = VMXInfo(DatasetRefNum, DatasetInfo)    'Refresh (record-count may have changed)
  245.     If rc <> VIS_OK Then
  246.         TellUser (INFO_ERROR)
  247.         ExitProgram 'Panic exit
  248.     End If
  249.     lblRecordsInFile.Caption = " " & Format$(DatasetInfo.RecordsInFile, "###,###,##0")
  250.     lblGroupSize.Caption = Str$(DatasetInfo.GroupSize)
  251.     lblGroupsUsed.Caption = " " & Format$(DatasetInfo.GroupsUsed, "##,##0")
  252.     lblFreeFileNoteSpace.Caption = " " & Format$(DatasetInfo.FreeFileNoteSpace, "#,##0")
  253.     FieldNum = 0
  254.     DisplayFieldInfo
  255. End Sub
  256. Sub mnuSpinHigher_Click ()
  257.     spnSpinButton_SpinDown
  258. End Sub
  259. Sub mnuSpinLower_Click ()
  260.     spnSpinButton_SpinUp
  261. End Sub
  262. Sub spnSpinButton_SpinDown ()
  263.     If FieldNum < NumberOfFields Then
  264.         FieldNum = FieldNum + 1
  265.         DisplayFieldInfo
  266.     End If
  267. End Sub
  268. Sub spnSpinButton_SpinUp ()
  269.     If FieldNum > 0 Then
  270.         FieldNum = FieldNum - 1
  271.         DisplayFieldInfo
  272.     End If
  273. End Sub
  274.